package com.java46.amqp;


import com.rabbitmq.client.Channel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
import org.springframework.amqp.support.converter.MessageConversionException;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;


/**
 * @ClassName MessageSender
 * @Description 定义消息接收者（消费者）
 * @Author Tigger Wu
 * @Date 2018/8/23
 * @Version 1.0
 **/
@Component
public class MessageConsumer implements MessageListener {
    private Logger logger = LoggerFactory.getLogger(MessageConsumer.class);


    public void onMessage(Message message) {
        System.out.println("--------------------------");
        System.out.println("进入创建订单" + message);
        logger.info("receive message:{}", message);
    }





}
